pub mod button;
pub mod main_menu;
pub mod game_single;
pub mod game_double;
pub mod game_over;
mod game_common;

use rusty_engine::prelude::*;
use crate::game_state::{GameScene, GameState};

pub fn scene_logic(engine: &mut Engine, state: &mut GameState) {
    match state.current_scene {
        GameScene::MainMenu => main_menu::logic(engine, state),
        GameScene::SingleGame => game_single::logic(engine, state),
        GameScene::DoubleGame => game_double::logic(engine, state),
        GameScene::GameOver => game_over::logic(engine, state),
    }
}

// 场景切换
pub fn switch_scene(state: &mut GameState, new_scene : GameScene) {
    let old_scene = state.current_scene;
    println!("切换场景: {:?} -> {:?}", old_scene, new_scene);

    state.current_scene = new_scene;
    state.last_scene = old_scene;
}
